package org.sidora.strata.explorer;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;


/**
 * Action which shows ContextExplorer component.
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class ContextExplorerAction extends AbstractAction {
    
    public ContextExplorerAction() {
        super(NbBundle.getMessage(ContextExplorerAction.class, "CTL_ContextExplorerAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(ContextExplorerTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        TopComponent win = ContextExplorerTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
    
    public void fillContextItems(){
        ContextExplorerTopComponent win = ContextExplorerTopComponent.findInstance();
        win.fillContextItems();
    }
    
    public void showEquals(){
        TopComponent win = ContextExplorerTopComponent.findInstance();
        win.getRootPane().setName("Roger");
    }
    
    public void cerrar(){
        ContextExplorerTopComponent win = ContextExplorerTopComponent.findInstance();
        win.close();
    }
    
}
